// APPLY(1, "提交申请"), FIRST_REVIEW(2, "初步审核"), FIRST_REJECT(3,"初审驳回"),
// COMPANY_ACCEPT(4,"公司同意"), COMPANY_REFUSE(5,"公司不同意"),
// COMPANY_TIME_OUT(6,"公司超时未处理"), SECOND_REVIEW(7, "详细审核"),
// SECOND_REJECT(8,"详审驳回");
export const SelectStatus = (str, info) => {
  switch (str) {
    case 1:
      return {
        current: 1,
        stepsInfo: [
          {
            title: '提交申请',
            date: info[0].createdAt
          }, {
            title: '初步审核中'
          }, {
            title: '详细审核'
          }
        ]
      }
    case 2:
      return {
        current: 1,
        stepsInfo: [
          {
            title: '提交申请',
            date: info[0].createdAt
          }, {
            title: '初审通过',
            date: info[1] && info[1].createdAt,
            confirm: {
              status: '0',
              visible: true,
              rate: info[1] && info[1].financingCostDto && info[1].financingCostDto.rate,
              financingAmount: info[1] && info[1].financingCostDto && info[1].financingCostDto.financingAmount
            }
          }, {
            title: '详细审核'
          }
        ]
      }
    case 3:
      return {
        current: 1,
        stepsInfo: [
          {
            title: '提交申请',
            date: info[0].createdAt
          }, {
            title: '驳回',
            date: info[1] && info[1].createdAt,
            failure: info[1] && (info[1].message ? info[1].message : '无')
          }, {
            title: '详细审核'
          }
        ]
      }
    case 4:
      return {
        current: 2,
        stepsInfo: [
          {
            title: '提交申请',
            date: info[0].createdAt
          }, {
            title: '初审通过',
            date: info[1] && info[1].createdAt,
            confirm: {
              status: '1', // 0没确认过状态  1成功 2失败
              rate: info[1] && info[1].financingCostDto && info[1].financingCostDto.rate,
              financingAmount: info[1] && info[1].financingCostDto && info[1].financingCostDto.financingAmount
            }
          }, {
            title: '详细审核中'
          }
        ]
      }
    case 5:
      return {
        current: 1,
        stepsInfo: [
          {
            title: '提交申请',
            date: info[0].createdAt
          }, {
            title: '结束',
            date: info[2] && info[2].createdAt,
            confirm: {
              status: '2', // 0没确认过状态  1成功 2失败
              rate: info[1] && info[1].financingCostDto && info[1].financingCostDto.rate,
              financingAmount: info[1] && info[1].financingCostDto && info[1].financingCostDto.financingAmount
            }
          }, {
            title: '详细审核'
          }
        ]
      }
    case 6:
      return {
        current: 1,
        stepsInfo: [
          {
            title: '提交申请',
            date: info[0].createdAt
          }, {
            title: '结束',
            date: info[1] && info[1].createdAt,
            confirm: {
              status: '2', // 0没确认过状态  1成功 2失败
              rate: info[1] && info[1].financingCostDto && info[1].financingCostDto.rate,
              financingAmount: info[1] && info[1].financingCostDto && info[1].financingCostDto.financingAmount
            }
          }, {
            title: '详细审核'
          }
        ]
      }
    case 7:
      return {
        current: 2,
        stepsInfo: [
          {
            title: '提交申请',
            date: info[0].createdAt
          }, {
            title: '初审通过',
            date: info[1] && info[1].createdAt,
            confirm: {
              status: '1', // 0没确认过状态  1成功 2失败
              rate: info[1] && info[1].financingCostDto && info[1].financingCostDto.rate,
              financingAmount: info[1] && info[1].financingCostDto && info[1].financingCostDto.financingAmount
            }
          }, {
            title: '已受理',
            date: info[3] && info[3].createdAt
          }
        ]
      }
    case 8:
      return {
        current: 2,
        stepsInfo: [
          {
            title: '提交申请',
            date: info[0].createdAt
          }, {
            title: '初审通过',
            date: info[1] && info[1].createdAt,
            confirm: {
              status: '1', // 0没确认过状态  1成功 2失败
              rate: info[1] && info[1].financingCostDto && info[1].financingCostDto.rate,
              financingAmount: info[1] && info[1].financingCostDto && info[1].financingCostDto.financingAmount
            }
          }, {
            title: '驳回',
            failure: info[3] && info[3].message,
            date: info[3] && info[3].createdAt
          }
        ]
      }
    default:
      return {
        current: 0,
        stepsInfo: [
          {
            title: '提交申请'
          }, {
            title: '初步审核',
            confirm: {
              visible: true
            }
          }, {
            title: '详细审核'
          }
        ]
      }
  }
}

export default SelectStatus
